<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '提现管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="jjr-user-withdraw-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>

    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            [ 'attribute'=>'real_name','label'=>'经纪人'],
            [ 'attribute'=>'name','label'=>'项目名称'],
            [ 'attribute'=>'client_real_name','label'=>'客户名称'],
            'amount',
            'card_no',
            //'bank_name',
            //'card_real_name',
            //'bank_branch_name',
            //'create_time',
            //'update_time',
            //'status',
            //'fail_reason',
            [ 'attribute'=>'transfer_status','label'=>'提现状态','value'=>function($model){
                if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_NOT_START){
                    return '未转账';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_STARTED){
                    return '转账中';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_END){
                    return '已转账';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_FAIL){
                    return '转账失败';
                }
            }],
            'create_time',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
    <!-- 定义数据块 -->
<?php $this->beginBlock('test'); ?>
    jQuery(document).ready(function() {
    highlight_subnav('jjr-user-withdraw/index'); //子导航高亮
    });
<?php $this->endBlock() ?>
    <!-- 将数据块 注入到视图中的某个位置 -->
<?php $this->registerJs($this->blocks['test'], \yii\web\View::POS_END); ?>